<%@page import="classes.AccountManager"%>
<%@page import="classes.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Secuirite Question</title>
</head>
<body>
	<form action="Password" method="post">
		<%
			String username = request.getParameter("userName");
			AccountManager manager = (AccountManager) request
					.getServletContext().getAttribute(
							AccountManager.ACCOUNTMANAGER);
			if(manager.isValidUserName(username)){
				User user = manager.getUser(username);
				String question = user.getQuestion();
				String name = user.getName();
				out.println(name + " " + question);
				out.println(" <p> Answer : <input type=\"text\" name=\"answer\" value=\"\"> </p>");
				out.println(" <input type= \"hidden\" name=\"user\" value =  " + username);
				out.println(" <input  type= \"submit\" name=\"butt\" value=\"Send\"> ");
			}
			else{
				out.println("<h1> There was not found such username.</h1>" );
			}
		%>
		<p>
			<a href="ForgotPassword.html">Try again ! </a>
			
		</p>
	</form>

</body>
</html>